<!DOCTYPE html>
<html lang="en">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <title>品牌新闻 - 可漾官网</title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="keywords" content="可漾  可漾官网   可漾红豆薏米水  可漾五红汤  可漾红豆水  可漾绿豆水  可漾牛蒡茶  可漾产品  山东可漾饮料有限公司" />
    <meta http-equiv="description"
      content="山东可漾饮料有限公司在以红豆薏米水为代表的谷物饮品方面已经形成了完善的研发、生产和销售体系，并申请了红豆水萃取提纯技术专利，产品一经上市便热销全网。其中抖音、淘宝平台销售额在同类产品中遥遥领先。" />
    <meta name="keywords" content="可漾  可漾官网   可漾红豆薏米水  可漾五红汤  可漾红豆水  可漾绿豆水  可漾牛蒡茶  可漾产品  山东可漾饮料有限公司" />
    <meta name="description"
      content="山东可漾饮料有限公司在以红豆薏米水为代表的谷物饮品方面已经形成了完善的研发、生产和销售体系，并申请了红豆水萃取提纯技术专利，产品一经上市便热销全网。其中抖音、淘宝平台销售额在同类产品中遥遥领先。" />
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <link rel="shortcut icon" href="../favicon.ico" type="image/x-icon" />
    <link rel="bookmark" href="../favicon.ico" />
    <meta name="viewport" content="user-scalable=yes, width=device-width, initial-scale=0.5">
    <link rel="stylesheet" href="../static/css/main.css">
    <link rel="stylesheet" href="../static/css/header.css">
    <link rel="stylesheet" href="../static/css/brandnew.min.css">
    <link rel="stylesheet" href="../static/css/footer.min.css">
    <style>
      .news-card{
        overflow: hidden;
      }
      .scale{
        transition: transform 0.2s ease-in-out;
      }
      .scale:hover{
        transform: scale(1.1);
      }
    </style>
  </head>
  <header>
    <div class="nav-box">
      <div id="logo" class="fl">
        <a href="../index.html"><img src="../static/images/Logo.png" alt="可漾"></a>
      </div>
      <ul class="nav fl clear">
        <a href="../index.html" class="nav-item nav-item1">首页</a>
        <a href="./about.html" class="nav-item">关于我们</a>  
        <span class="nav-item-wrap">
          <a href="./product.html" class="nav-item">
            <span class="nav-span">可漾产品</span>
          </a>
          <ul class="nav-list nav-list-prod">
            <!-- <li class="nav-li">红豆薏米水</li>
            <li class="nav-li">绿豆水</li>
            <li class="nav-li">五红汤</li>
            <li class="nav-li">红豆水</li>
            <li class="nav-li">红豆牛蒡茶</li> -->
          </ul>
        </span>  
        <span class="nav-item-wrap nav-item-wrap2">
          <a href="#" class="nav-item active">
            <span class="nav-span">企业动态</span>
          </a>
          <ul class="nav-list nav-list2 nav-list-dynamic">
            <li class="nav-li">
              <a href="./brandnew.html">品牌新闻</a>
            </li>
            <li class="nav-li">
              <a href="./enterpriseactivity.html">企业活动</a>
            </li>
            <li class="nav-li">
              <a href="./wonderfulmoment.html">精彩瞬间</a>
            </li>
          </ul>
        </span>
        <a href="./join.html" class="nav-item">加入我们</a>  
      </ul>
    </div>
  </header>
  <main>
    <h1 class="main-title">品牌新闻</h1>
    <p class="main-desc"></p>
    <div class="news-card-box clear">
    </div>
    <div class="pagination"></div>
    
  </main>
  <!-- 底部区域 -->
  <footer>
    <div class="footer flex">
      <ul class="link-box flex">
        <li>
          <h3>关于我们</h3>
          <p><a href="./about.html#about-box">企业介绍</a></p>
          <p><a href="./about.html#mission-box">企业使命</a></p>
          <p><a href="./about.html#roadmap">企业发展</a></p>
        </li>
        <li class="footer-prod-list">
          <!-- <h3>可漾产品</h3>
          <p><a href="#">红豆薏米水</a></p>
          <p><a href="#">绿豆水</a></p>
          <p><a href="#">五红汤</a></p>
          <p><a href="#">红豆水</a></p>
          <p><a href="#">红豆牛蒡茶</a></p> -->
        </li>
        <li>
          <h3>企业动态</h3>
          <p><a href="./brandnew.html">品牌新闻</a></p>
          <p><a href="./enterpriseactivity.html">企业活动</a></p>
          <p><a href="./wonderfulmoment.html">精彩瞬间</a></p>
        </li>
        <li>
          <h3>加入我们</h3>
          <p><a href="./join.html">未来展望</a></p>
          <p><a href="./join.html">招商加盟</a></p>
        </li>
      </ul>
      <ul class="addr-box">
        <h2>怕湿气，喝可漾</h2>
        <p>山东可漾饮料有限公司</p>
        <p>售后服务热线：4006279199</p>
        <p>地址：山东省潍坊市坊子区黄旗堡街办一马路</p>
        <ul class="feedback flex-start">
          <li class="qr">
            <img src="../static/images/qrcode.png" alt="">
            <span>关注微信公众号</span>
            <img class="qrcode-scan" src="../static/images/qrcode-scan.png" alt="">
          </li>
          <!-- <li class="email">
            <img src="../static/images/email.png" alt="">
            <span>投诉意见</span>
            <div class="email-feed">
              邮箱：<a href="mailto:qdcsx@163.com">qdcsx@163.com</a>
            </div>
          </li> -->
        </ul>
      </ul>
    </div>
    <div class="right"><a href="https://beian.miit.gov.cn/#/Integrated/index">鲁ICP备19040840号-1</a></div>
  </footer>
  <script src="../static/js/master.js"></script>
  <script src="../static/libs/jquery-1.10.1.min.js"></script>
  <script src="../static/libs/pagination.js"></script>
  <script>
    var baseUrl = 'http://guanwang.keyangyinliao.com/api';
    $(function () {
    // 商品列表
      var prodListData = [];
      getProdList();
      function getProdList() {
        $.ajax({
          url: baseUrl + '/ad',
          type: 'get',
          dataType: 'json',
          success: function (res) {
            if (res.code !== 200) return;
            prodListData = res.data;
            initNavProds()
          }
        })
      }

      function initNavProds() {
        var prodListHeadSubHtml = '',
        footerProdListHtml = '<h3>可漾产品</h3>';

        $.each(prodListData, function(i) {
          prodListHeadSubHtml += '<li class="nav-li" data-id=' + prodListData[i].id + '>' + prodListData[i].title + '</li>'
        
          footerProdListHtml += '<p><a href="./product.html?id=' + prodListData[i].id + '">' + prodListData[i].title + '</a></p>';
        })


        // 头部导航[产品]下的【子产品】导航
        $('.nav-list-prod').append(prodListHeadSubHtml);
        $('.nav-list-prod .nav-li').each(function(i) {
          $(this).click(function() {
            window.location.href = './product.html?id=' + $(this).attr('data-id');
          })
        })

        // footer里的产品信息
        $('.footer-prod-list').append(footerProdListHtml);
      }

      // 品牌新闻列表
      var brandNewsData = [],
        brandNewsDataList = [],
        brandNewsHtml = '';
      getBrandNewsList(9, 0, true)
      function getBrandNewsList(limit, offset, isFirstInit) {
        $.ajax({
          url: baseUrl + '/article/listByCategoryName',
          type: 'get',
          dataType: 'json',
          data: {
            category_name: '品牌新闻',
            limit: limit,
            offset: offset
          },
          success: function (res) {
            if (res.code !== 200) return;

            brandNewsData = res.data;

            // 设置首页分类的描述信息
            $('.main-desc').text(brandNewsData.category_desc);

            // 只有第一次进来才初始化页码
            if (isFirstInit) {
              setCasePage(brandNewsData.count, 9)
            }
            brandNewsDataList = brandNewsData.list;
            initBrandnewList()
          }
        })
      }

      // 设置品牌新闻dom
      function initBrandnewList() {
        // 每次切换页重置内容为空
        brandNewsHtml = '';
        $.each(brandNewsDataList, function(i) {
          brandNewsHtml += '<ul class="news-card fl" data-id="' + brandNewsDataList[i].id + '" data-category="' + brandNewsDataList[i].article_categorie.name + '">' +
            '<div class="thumb scale" style="background:url('+ brandNewsDataList[i].banner_img +') no-repeat;background-size:cover">' +
              // '<img class="scale-img animate-transition" src="' + brandNewsDataList[i].banner_img + '" alt="">' +
              
            '</div>' +
            '<li class="content">' +
              '<h3 class="title eq2">' + brandNewsDataList[i].title + '</h3>' +
              '<p class="desc eq3">' +
                brandNewsDataList[i].desc +
              '</p>' +
              '<div class="time-box">' +
                '<span class="time">' + brandNewsDataList[i].created_at + '</span>' +
              '</div>' +
            '</li>' +
          '</ul>'
        })

        $('.news-card-box').empty();
        $('.news-card-box').append(brandNewsHtml);

        // 点击品牌新闻跳文章
        $('.news-card').click(function() {
          window.location.href = './detail.html?id=' + $(this).attr('data-id') + '&category=' + $(this).attr('data-category');
        })

        // 列表数小于0的话没必要弄分页了
        // if (brandNewsData.count > 0) {
        //   $('.pagination').show()
          
        // } else {
        //   $('.pagination').hide()
        // }
      }

      /**
   * 设置分页
   * pages: 总页数
   * pageSize:每页显示数量
   * 
   * */
  function setCasePage(pages, pageSize) {
    $(`.pagination`).pagination({
      coping: true,
      homePage: '',
      endPage: '',
      totalData: pages,
      showData: pageSize,
      activeCls: 'active',
      mode: 'unfixed',
      count: 2,
      callback: function (api) {
        getBrandNewsList(9, (api.getCurrent() - 1) * 9, false)
      }
    });
  }
})
  </script>
</html>